import {defineStore} from 'pinia'

interface LayoutState {
    isCollapse: boolean,
    isFooterVisible: boolean,
    isLogoVisible: boolean,
    logoUrl: string,
    projectTitle: string
}

export const useLayoutStore = defineStore('layout', {
    state: (): LayoutState => ({
        isCollapse: false,
        isFooterVisible: true,
        isLogoVisible: true,
        logoUrl: '/public/logo.jpg',
        projectTitle: 'My Project'
    }),
    actions: {
        toggleSidebar() {
            this.isCollapse = !this.isCollapse
        },
        toggleFooterVisibility() {
            this.isFooterVisible = !this.isFooterVisible
        },
        toggleLogoVisibility() {
            this.isLogoVisible = !this.isLogoVisible
        },
        updateLogoUrl(newUrl: string) {
            this.logoUrl = newUrl
        },
        updateProjectTitle(newTitle: string) {
            this.projectTitle = newTitle
        }
    }
})